import request from '@/utils/request';

// 充值统计
export async function rechargeAmount(data) {
  const res = await request.post('/rechargeAmount', data);
  if (res.data.code === 0) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.message));
}
// 用户统计
export async function userCount(data) {
  const res = await request.post('/userCount', data);
  if (res.data.code === 0) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.message));
}
// 平台收益
export async function platformIncome(data) {
  const res = await request.post('/statistics/platformIncome', data);
  if (res.data.code === 0) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.message));
}
// 提现统计
export async function withdrawal(data) {
  const res = await request.post('/Statistics/withdrawal', data);
  if (res.data.code === 0) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.message));
}
// 消费统计
export async function consumption(data) {
  const res = await request.post('/consumption', data);
  if (res.data.code === 0) {
    return res.data;
  }
  return Promise.reject(new Error(res.data.message));
}
